package com.biz.primus.base.elasticsearch.entities;

import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldIndex;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

/**
 * 商品基础信息
 *
 * @author Nian.Li
 * @ClassName: Product 
 * @Description: TODO
 * @date 2016年8月23日 下午10:37:57    
 */
@Data
public class ProductBaseEntity implements Serializable {

    private static final long serialVersionUID = 5521992117593324650L;

    /**
     * 商品id
     */
    @Field(type = FieldType.String, index = FieldIndex.not_analyzed, store = true)
    private String productId;

    /**
     * 商家 ID
     */
    @Field(type = FieldType.String, index = FieldIndex.not_analyzed, store = true)
    private String vendorId;

    /**
     * 商品类型
     */
    @Field(type = FieldType.Integer, index = FieldIndex.not_analyzed)
    private Integer productType;

    /**
     * 商品名称
     */
    @Field(type = FieldType.String, store = true, analyzer = "ik", searchAnalyzer = "ik_max_word")
    private String name;

    /**
     * seotitle
     */
    @Field(type = FieldType.String, store = true, analyzer = "ik", searchAnalyzer = "ik_smart")
    private String seoTitle;

    /**
     * 商品名称
     */
    @Field(type = FieldType.String, store = true, analyzer = "ik", searchAnalyzer = "ik_smart")
    private String seoKeywords;

    /**
     * 商品名称
     */
    @Field(type = FieldType.String, store = true, analyzer = "ik", searchAnalyzer = "ik_smart")
    private String seoDescription;

    /**
     * 商品编码
     */
    @Field(type = FieldType.String, index = FieldIndex.not_analyzed, store = true)
    private String productCode;

    /**
     * 平均分
     */
    @Field(type = FieldType.Integer, store = true)
    private Integer score;

    /**
     * 总分
     */
    @Field(type = FieldType.Integer, store = true)
    private Integer totalScore;

    /**
     * 总评分数
     */
    @Field(type = FieldType.Integer, store = true)
    private Integer scoreCount;

    /**
     * 销量
     */
    @Field(type = FieldType.Integer, store = true)
    private Integer salesVolume;

    /**
     * 点击量
     */
    @Field(type = FieldType.Integer, store = true)
    private Integer viewVolume;

    /**
     * 分类
     */
    @Field(type = FieldType.Long, store = true,index = FieldIndex.not_analyzed)
    private Long category;

    /**
     * 品牌Id
     */
    @Field(type = FieldType.Long, store = true,index = FieldIndex.not_analyzed)
    private Long brand;

    /**
     * 商品销售标签
     */
    @Field(type = FieldType.String, index = FieldIndex.not_analyzed, store = true)
    private String saleTags;

    /**
     * 商品销售标签ID集合
     */
    @Field(type = FieldType.String, store = true, analyzer = "ik", searchAnalyzer = "ik_smart")
    private String saleTagIds;

    /**
     * 销售价
     */
    @Field(type = FieldType.Integer, store = true)
    private Integer finalPrice;

    /**
     * 全局排序
     */
    @Field(type = FieldType.Integer)
    private Integer globalIdx;

    /**
     * 商品扩展属性
     */
    @Field(type = FieldType.Nested)
    private List<PropertyEntity> propertiesNested;

    /**
     * 上架时间
     */
    @Field(type = FieldType.Date, store = true)
    private Timestamp onSaleTime;

}
